!!!
%html
  %body
    .span15
      .container
        .col-md-12
          .row
            .page-header
              %h1
                Search
        .container
          .row
            .col-md-12
              %form{action: '/search', method: 'post'}
                .form-group.col-xs-2
                  %select.form-control{id: 'search_type', name: 'search_type'}
                    - if params[:search_type] == 'username'
                      %option{value: 'username', name: 'search_type', type: 'button', selected: 'selected'} Username
                    - else
                      %option{value: 'username', name: 'search_type', type: 'button'} Username
                    - if params[:search_type] == 'hash'
                      %option{value: 'hash', name: 'search_type', type: 'button', selected: 'selected'} Hash
                    - else
                      %option{value: 'hash', name: 'search_type', type: 'button'} Hash
                    - if params[:search_type] == 'password'
                      %option{value: 'password', name: 'search_type', type: 'button', selected: 'selected'} Password
                    - else
                      %option{value: 'password', name: 'search_type', type: 'button'} Password
                .form-group.col-md-8
                  %input{type: 'textbox', class: 'form-control', name: 'value', id: 'value', placeholder: 'Search for...'}
                .form-group.col-xs-2
                  %button.btn.btn-primary{type: 'submit'} Search
        %br
        %br
        .row
          .col-md-12
            .table
              %table{class: 'table table-striped'}
                %thead
                  %tr
                    %th Username
                    %th Plaintext
                    %th Type
                    %th Hash
                    %th Customer
                %tbody
                  %tr
                  - if @results
                    - @results.each do |entry|
                      %td #{entry['username']}
                      %td
                        // LC && RC
                        - if entry['local_cracked'] == '1' and entry['hub_cracked'] == '1'
                          #{entry['plaintext']}
                          // LC && RU
                        - elsif entry['local_cracked'] == '1' and entry['hub_cracked'] == '0'
                          #{entry['plaintext']}
                          // LU && RC
                        - elsif entry['local_cracked'] == '0' and entry['hub_cracked'] == '1'
                          - if entry['show_hub_results'] == '1'
                            %a.btn.btn-success{href: "/hub/hash/reveal/hash/#{entry['id']}"}
                              reveal
                          - else
                            %em uncracked
                          // LU && RU
                        - else
                          %em uncracked
                      %td #{modeToFriendly(entry['hashtype'].to_s)}
                      %td #{entry['originalhash']}
                      %td #{entry['name']}
                      %tr
                  - else
                    %td "No Results"
                    %tr
